package ${servicePackageName}.service.sys;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.IService;
import ${servicePackageName}.dto.ResourceRoleTreeParentDto;
import ${servicePackageName}.dto.ResourceTreeParentDto;
import ${servicePackageName}.entity.sys.SysResource;
import ${servicePackageName}.qo.sys.ResourceReq;

/**
 * <p>
 * 菜单资源表 服务类
 * </p>
 *
 * @author lizihao
 * @since 2020-11-18
 */
public interface ISysResourceService extends IService<SysResource> {

	/**
	 * 查询用户权限
	 * @param userId 用户id
	 * @return 资源树结构
	 * @throws Exception 异常
	 */
	List<ResourceRoleTreeParentDto> selectUserResourceList(Long userId)throws Exception;
	
	/**
	 * 保存或者更新用户
	 * @param resourceReq 请求体
	 * @throws Exception 异常
	 */
	void saveOrUpdateUser(ResourceReq resourceReq) throws Exception;
	
	/**
	 * 获取所有资源
	 * @return 资源树结构
	 * @throws Exception 异常
	 */
	List<ResourceTreeParentDto> getAllResource()throws Exception;
	
	/**
	 * 获取所有资源带角色锚点
	 * @param roleId 角色id
	 * @return 资源树结构
	 * @throws Exception 异常
	 */
	List<ResourceTreeParentDto> getAllResourceWithUser(Long roleId)throws Exception;
}
